﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NUnit.Framework;
using MySql.Data.MySqlClient;

namespace TestDAL
{
    public class TesteDAL
    {
        [TestFixture]
        public class AccountTest
        {
            [Test]
            public void TestMateriaAdd()
            {
                quizdb.QuizDb db = new quizdb.QuizDb(new MySqlConnection("Persist Security Info=False;server=localhost;database=quizdb;uid=root;server=localhost;database=quizdb;uid=root;pwd='';initial catalog=quizdb"));

                quizdb.MaterIA m = new quizdb.MaterIA();
                m.Nome = "Nova";
                db.MaterIA.InsertOnSubmit(m);
                db.SubmitChanges();
                var materias = (from h in db.MaterIA
                               where h.Nome== "Nova"
                               select h).First();
                Assert.AreEqual(materias.Nome, m.Nome);
                               
                db.Dispose();
            }
        }
    }
}


